diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2023-02-18 15:25:29 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2023-02-18 15:25:29 +0100 |
| commit | 69d345b334c7a3fecdb0cd5f440fabd83a755309 (patch) | |
| tree | 09de5c21f7989a98397e6e700f8d4e9347e8bd90 /src/routes/[lang=lang]/sections/description.svelte | |
| parent | c709aa638c7d3458dd73c3aabadb4924cb1cb80e (diff) | |
| download | auroraklinikken.no-69d345b334c7a3fecdb0cd5f440fabd83a755309.tar.xz auroraklinikken.no-69d345b334c7a3fecdb0cd5f440fabd83a755309.zip | |
.
Diffstat (limited to 'src/routes/[lang=lang]/sections/description.svelte')
| -rw-r--r-- | src/routes/[lang=lang]/sections/description.svelte | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/routes/[lang=lang]/sections/description.svelte b/src/routes/[lang=lang]/sections/description.svelte new file mode 100644 index 0000000..79a3939 --- /dev/null +++ b/src/routes/[lang=lang]/sections/description.svelte @@ -0,0 +1,26 @@ +<script context="module" lang="ts"> + export type DescriptionModel = { + title: string; + content?: any; + }; +</script> + +<script lang="ts"> + import { PortableText } from "@portabletext/svelte"; + export let model: DescriptionModel; + + let visible = true; + + $: if (!model.title) { + visible = false; + } else { + visible = true; + } +</script> + +{#if visible} + <h3>{model.title}</h3> + {#if model.content} + <PortableText value={model.content} /> + {/if} +{/if} |
